home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / intrfc61.arc / NAMETYPE.PAS < prev    next >
Pascal/Delphi Source File  |  1991-03-28  |  3KB  |  105 lines

  1. unit nametype;
  2.  
  3. { Unit of type/const definitions for namelist unit }
  4.  
  5. interface
  6. type
  7.   type_def_ptr = ^type_def_rec;
  8.   type_def_rec = record
  9.     type_type : byte;
  10.     other_byte : byte;
  11.     size : word;
  12.     base_type : word;
  13.     case integer of
  14.     1 : ( element_ofs,element_unit,index_ofs,index_unit: word );
  15.     2 : ( hash_ofs, first_ofs :word;
  16.   {3}     parent_ofs, parent_unit, vmt_size :word;
  17.   {3}     handle,w10,self_type_ofs : word );
  18.     7 : ( base_ofs,base_unit:word );
  19.     6 : ( return_ofs,return_unit,num_args:word );
  20.     8 : ( target_ofs,target_unit:word );
  21.    15 : ( lower,upper : longint;
  22.           type_ofs,type_unit:word
  23.         );
  24.    -1 : ( who_knows : array[3..8] of word
  25.         );
  26.   end;
  27.  
  28.   type_info_ptr = ^type_info_rec;
  29.   type_info_rec = record
  30.     type_def_ofs,type_unit : word;
  31.   end;
  32.  
  33.   var_flags = set of (const_flag,      { initialized data }
  34.                       local,           { on the stack     }
  35.                       referenced,      { var parameter    }
  36.                       field,           { field of a record or object }
  37.                       absolute,        { declared absolute something else }
  38.                       argument,        { an argument to the func/proc }
  39.                       v64,v128);
  40.  
  41.   var_info_ptr = ^var_info_rec;
  42.   var_info_rec = record
  43.     flags : var_flags;
  44.     offset,  { within the appropriate section }
  45.     in_unit, { either unit number if absolute, or data block number }
  46.     type_def_ofs,type_unit : word;
  47.   end;
  48.  
  49.   const_info_ptr = ^const_info_rec;
  50.   const_info_rec = record
  51.     type_def_ofs,type_unit : word;
  52.     case integer of
  53.     0:  (intval:longint);
  54.     1:  (realval:real);    { never used? }
  55.     2:  (stringval:string);
  56.     3:  (extendval:extended);
  57.     4:  (boolval:boolean);
  58.     5:  (charval:char);
  59.     end;
  60.  
  61.   arg_ptr = ^arg_rec;
  62.   arg_rec = record
  63.     type_def_ofs,type_unit : word;
  64.     flags : var_flags;
  65.   end;
  66.  
  67.   func_type_ptr = ^func_type_rec;
  68.   func_type_rec = record
  69.     type_def_ofs,type_unit,num_args : word;
  70.   end;
  71.  
  72.   code_flags = set of (far_entry,inline_code,f4,external_code,method,construct,
  73.                        destruct,assembler);
  74.  
  75.   func_info_ptr = ^func_info_rec;
  76.   func_info_rec = record
  77.     code_type:code_flags;
  78.     b2 : byte;
  79.     entry_ofs,parent_ofs,local_hash,vmt_entry,next_method,w6,w7:word;
  80.     func_type : func_type_rec;
  81.   end;
  82.  
  83.  
  84. const
  85.   record_id   =  2;
  86.   object_id   =  3;
  87.   objpriv_id  =  4;
  88.   const_id    = 80;
  89.   type_id     = 81;
  90.   var_id      = 82;
  91.   proc_id     = 83;
  92.   sys_proc_id = 84;
  93.   sys_fn_id   = 85;
  94.   sys_new_id  = 86;
  95.   sys_port_id = 87;
  96.   sys_mem_id  = 88;
  97.   unit_id     = 89;
  98.   init_id     = 128;   { Just hope that these haven't already been taken! }
  99.   uses_id     = 129;
  100.   local_id    = 130;
  101.   referenced_id = 131;
  102.  
  103. implementation
  104. end.
  105.